Optimal. Leaf size=29 \[ -\log (a+x)-\frac{2 \tan ^{-1}\left (\frac{a-2 x}{\sqrt{3} a}\right )}{\sqrt{3}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0578282, antiderivative size = 29, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {1593, 1868, 31, 617, 204} \[ -\log (a+x)-\frac{2 \tan ^{-1}\left (\frac{a-2 x}{\sqrt{3} a}\right )}{\sqrt{3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1593
Rule 1868
Rule 31
Rule 617
Rule 204
Rubi steps
\begin{align*} \int \frac{2 a x-x^2}{a^3+x^3} \, dx &=\int \frac{(2 a-x) x}{a^3+x^3} \, dx\\ &=a \int \frac{1}{a^2-a x+x^2} \, dx-\int \frac{1}{a+x} \, dx\\ &=-\log (a+x)+2 \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,1-\frac{2 x}{a}\right )\\ &=-\frac{2 \tan ^{-1}\left (\frac{a-2 x}{\sqrt{3} a}\right )}{\sqrt{3}}-\log (a+x)\\ \end{align*}
Mathematica [A] time = 0.0138302, size = 57, normalized size = 1.97 \[ \frac{1}{3} \left (\log \left (a^2-a x+x^2\right )-\log \left (a^3+x^3\right )-2 \log (a+x)+2 \sqrt{3} \tan ^{-1}\left (\frac{2 x-a}{\sqrt{3} a}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.007, size = 29, normalized size = 1. \begin{align*} -\ln \left ( a+x \right ) +{\frac{2\,\sqrt{3}}{3}\arctan \left ({\frac{ \left ( 2\,x-a \right ) \sqrt{3}}{3\,a}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.41899, size = 35, normalized size = 1.21 \begin{align*} \frac{2}{3} \, \sqrt{3} \arctan \left (-\frac{\sqrt{3}{\left (a - 2 \, x\right )}}{3 \, a}\right ) - \log \left (a + x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.991842, size = 80, normalized size = 2.76 \begin{align*} \frac{2}{3} \, \sqrt{3} \arctan \left (-\frac{\sqrt{3}{\left (a - 2 \, x\right )}}{3 \, a}\right ) - \log \left (a + x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] time = 0.287255, size = 54, normalized size = 1.86 \begin{align*} - \log{\left (a + x \right )} - \frac{\sqrt{3} i \log{\left (- \frac{a}{2} - \frac{\sqrt{3} i a}{2} + x \right )}}{3} + \frac{\sqrt{3} i \log{\left (- \frac{a}{2} + \frac{\sqrt{3} i a}{2} + x \right )}}{3} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.06164, size = 36, normalized size = 1.24 \begin{align*} \frac{2}{3} \, \sqrt{3} \arctan \left (-\frac{\sqrt{3}{\left (a - 2 \, x\right )}}{3 \, a}\right ) - \log \left ({\left | a + x \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]